﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FJERP.DAL;
using FJERP.Model;
using System.Data;

namespace FJERP.BLL
{
    public class PurchaseBLL
    {
        PurchaseDAL dal = new PurchaseDAL();
        /// <summary>
        /// 获取商品信息
        /// </summary>
        /// <returns></returns>
        public List<Product> GetProduct()
        {
            return dal.GetProduct();
        }
        /// <summary>
        /// 仓库下拉框
        /// </summary>
        /// <returns></returns>
        public List<WareHose> GetWareHoseList()
        {

            return dal.GetWareHoseList();
        }
        /// <summary>
        /// 供应商下拉框
        /// </summary>
        /// <returns></returns>
        public List<Supplier> GetSupplierList()
        {
            return dal.GetSupplierList();
        }
        /// <summary>
        /// 经办人下拉框
        /// </summary>
        /// <returns></returns>
        public List<Employee> GetEmployeeList()
        {
            return dal.GetEmployeeList();
        }
        public List<Product> SearchProductByModelspe(string Product_Modelspe)
        {
            return dal.SearchProductByModelspe(Product_Modelspe);
        }
        /// <summary>
        /// 添加采购入库单信息
        /// </summary>
        /// <param name="P"></param>
        /// <param name="xml"></param>
        /// <returns></returns>
        public int Purchase_IntoList(Purchase P, string xml)
        {
            return dal.Purchase_IntoList(P, xml);
        }
        /// <summary>
        /// 显示采购主表
        /// </summary>
        /// <returns></returns>
        public List<Purchase> PurIntoShow()
        {
            return dal.PurIntoShow();
        }
        /// <summary>
        /// 审核页面的主表显示
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<Purchase> PurCheckMain(int id)
        {
            return dal.PurCheckMain(id);
        }
        /// <summary>
        /// 审核页面的子表显示
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<PurchaseMate> PurCheckMate(int id)
        {
            return dal.PurCheckMate(id);

        }
        /// <summary>
        /// 入库操作
        /// </summary>
        /// <param name="Purchase_Id"></param>
        /// <returns></returns>
        public int IntoStock(int Purchase_Id)
        {
            return dal.IntoStock(Purchase_Id);
        }
        /// <summary>
        /// 采购订单分页显示
        /// </summary>
        /// <param name="Pageindex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public List<Purchase> Purchase_Show(int Pageindex, int PageSize)
        {
            return dal.Purchase_Show(Pageindex, PageSize);
        }
        public int count()
        {
            return dal.count();
        }

        /// <summary>
        /// 添加采购返厂单信息
        /// </summary>
        /// <param name="P"></param>
        /// <param name="xml"></param>
        /// <returns></returns>
        public int Purchase_Add(Purchase P, string xml)
        {
            return dal.Purchase_Add(P, xml);
        }
        /// <summary>
        /// 显示商品信息
        /// </summary>
        /// <param name="Product_Modelspe"></param>
        /// <returns></returns>
        public DataTable Product_Sel(string Product_Modelspe)
        {
            return dal.Product_Sel(Product_Modelspe);
        }
    }
}
